import React from "react";
import { View, Text } from "react-native";
import { useTheme } from "@/contexts/ThemeContext";
import styles from "./Divider.style";

interface DividerProps {
  text: string;
}

const Divider: React.FC<DividerProps> = ({ text }) => {
  const { colors } = useTheme();

  return (
    <View style={styles.container}>
      <View style={[styles.line, { backgroundColor: colors.border.divider }]} />
      <Text style={[styles.text, { color: colors.text.secondary }]}>
        {text}
      </Text>
      <View style={[styles.line, { backgroundColor: colors.border.divider }]} />
    </View>
  );
};

export default Divider;
